package com.zaofan.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zaofan.bean.ShopPayLable;
import com.zaofan.dao.ShopPayLableDao;

public class ShopPayLableService {

	private ShopPayLableDao shopPayDao = new ShopPayLableDao();

	public void delete(ShopPayLable lable) {
		shopPayDao.del(lable);
	}

	public void add(ShopPayLable lable) {
		shopPayDao.add(lable);
	}

	public void update(ShopPayLable lable) {
		shopPayDao.update(lable);
	}

	public List<ShopPayLable> findAll(Map<String, Object> params) {
		List<ShopPayLable> data = shopPayDao.findAll(params);
		if (data == null) {
			data = new ArrayList<>();
		}
		return data;
	}

	public Long count(Map<String, Object> params) {
		return shopPayDao.count(params);
	}

	public ShopPayLable findById(Integer id) {
		Map<String, Object> params = new HashMap<>();
		params.put("id", id);
		return shopPayDao.findOne(params);
	}

	public List<ShopPayLable> findByShopId(int shopId) {
		Map<String, Object> params = new HashMap<>();
		params.put("shopId", shopId);
		return findAll(params);
	}

	public void deleteByShopId(int shopId) {
		shopPayDao.deleteByShopId(shopId);
	}

}
